import request from '@/utils/request'
// 获取档案树
export function gettrees(query) {
    return request({
      url: '/archive/trees/gettreescomplate',
      method: 'get',
      params: query
    })
}

// 根据门类id获取数据  /archive/category/194285463689891840
export function getData(id) {
  return request({
    url: '/archive/category/' + id,
    method: 'get'
  })
}

// 增加节点
export function addCode(data) {
  return request({
    url: '/archive/trees',
    method: 'post',
    data: data
  })
}

// 获取节点列表
export function listCode(query) {
  return request({
    url: '/archive/trees/list',
    method: 'get',
    params: query
  })
}

// 获取节点明细
export function getCode(id) {
  return request({
    url: '/archive/trees/' + id,
    method: 'get'
  })
}

// 修改节点
export function updateCode(data){
  return request({
    url: '/archive/trees',
    method: 'put',
    data: data
  })
}

// 删除节点
export function delCode(id) {
  return request({
    url: '/archive/trees/' + id,
    method: 'delete'
  })
}

// 获取全宗
export function getFondsByTenantCode(query) {
  return request({
    url: '/manage/fonds/getFondsByTenantCode',
    method: 'get',
    params: query
  })
}

// 获取门类
export function getcatebyfondsid(id) {
  return request({
    url: '/archive/category/getcatebyfondsid/' + id,
    method: 'get'
  })
}

// 获取门类类型
export function getCateType(id) {
  return request({
    url: '/archive/category/' + id,
    method: 'get'
  })
}

// 获取分类节点
export function getfl(data) {
  return request({
    url: '/archive/trees/getfl',
    method: 'post',
    data: data
  })
}

//获取角色树
export function getroletree(query) {
  return request({
    url: '/archive/trees/getroletree',
    method: 'GET',
    params: query
  })
}


//获取菜单树
export function getmunutreebyrole(ID) {
  return request({
    url: '/archive/trees/getmunutreebyrole/'+ID,
    method: 'GET',
  })
}

//获取选中角色,选中菜单的档案树回显
export function gettreebyrolemenuxh(ID,munuID) {
  return request({
    url: '/archive/trees/gettreebyrolemenuxh/'+ID+"/"+munuID,
    method: 'GET',
  })
}

//添加树授权
export function addtreeshouquan(data) {
  return request({
    url: '/archive/trees/addtreeshouquan',
    method: 'POST',
    data: data
  })
}

